import java.util.Vector;

class P725 {
   private static Vector[] vectors;

   public static void main(String[] args) {
       vectors = new Vector[80];
       for (int k = 0; k < 80; k++) {
           vectors[k] = new Vector();
       }
       vectors[2].addElement("13458 / 06729 = 2");
       vectors[2].addElement("13584 / 06792 = 2");
       vectors[2].addElement("13854 / 06927 = 2");
       vectors[2].addElement("14538 / 07269 = 2");
       vectors[2].addElement("14586 / 07293 = 2");
       vectors[2].addElement("14658 / 07329 = 2");
       vectors[2].addElement("15384 / 07692 = 2");
       vectors[2].addElement("15846 / 07923 = 2");
       vectors[2].addElement("15864 / 07932 = 2");
       vectors[2].addElement("18534 / 09267 = 2");
       vectors[2].addElement("18546 / 09273 = 2");
       vectors[2].addElement("18654 / 09327 = 2");
       vectors[2].addElement("26970 / 13485 = 2");
       vectors[2].addElement("27096 / 13548 = 2");
       vectors[2].addElement("27690 / 13845 = 2");
       vectors[2].addElement("29076 / 14538 = 2");
       vectors[2].addElement("29370 / 14685 = 2");
       vectors[2].addElement("29670 / 14835 = 2");
       vectors[2].addElement("29706 / 14853 = 2");
       vectors[2].addElement("29730 / 14865 = 2");
       vectors[2].addElement("30972 / 15486 = 2");
       vectors[2].addElement("32970 / 16485 = 2");
       vectors[2].addElement("37092 / 18546 = 2");
       vectors[2].addElement("37290 / 18645 = 2");
       vectors[2].addElement("41358 / 20679 = 2");
       vectors[2].addElement("41538 / 20769 = 2");
       vectors[2].addElement("41586 / 20793 = 2");
       vectors[2].addElement("46158 / 23079 = 2");
       vectors[2].addElement("53418 / 26709 = 2");
       vectors[2].addElement("53814 / 26907 = 2");
       vectors[2].addElement("54138 / 27069 = 2");
       vectors[2].addElement("54186 / 27093 = 2");
       vectors[2].addElement("54618 / 27309 = 2");
       vectors[2].addElement("58134 / 29067 = 2");
       vectors[2].addElement("58146 / 29073 = 2");
       vectors[2].addElement("58614 / 29307 = 2");
       vectors[2].addElement("61458 / 30729 = 2");
       vectors[2].addElement("61584 / 30792 = 2");
       vectors[2].addElement("61854 / 30927 = 2");
       vectors[2].addElement("62970 / 31485 = 2");
       vectors[2].addElement("64158 / 32079 = 2");
       vectors[2].addElement("65418 / 32709 = 2");
       vectors[2].addElement("65814 / 32907 = 2");
       vectors[2].addElement("69702 / 34851 = 2");
       vectors[2].addElement("70296 / 35148 = 2");
       vectors[2].addElement("70962 / 35481 = 2");
       vectors[2].addElement("76290 / 38145 = 2");
       vectors[2].addElement("76902 / 38451 = 2");
       vectors[2].addElement("90276 / 45138 = 2");
       vectors[2].addElement("90372 / 45186 = 2");
       vectors[2].addElement("90762 / 45381 = 2");
       vectors[2].addElement("92370 / 46185 = 2");
       vectors[2].addElement("93702 / 46851 = 2");
       vectors[2].addElement("96270 / 48135 = 2");
       vectors[2].addElement("96702 / 48351 = 2");
       vectors[2].addElement("97026 / 48513 = 2");
       vectors[2].addElement("97032 / 48516 = 2");
       vectors[2].addElement("97062 / 48531 = 2");
       vectors[2].addElement("97230 / 48615 = 2");
       vectors[2].addElement("97302 / 48651 = 2");
       vectors[3].addElement("17469 / 05823 = 3");
       vectors[3].addElement("17496 / 05832 = 3");
       vectors[3].addElement("50382 / 16794 = 3");
       vectors[3].addElement("53082 / 17694 = 3");
       vectors[3].addElement("61749 / 20583 = 3");
       vectors[3].addElement("69174 / 23058 = 3");
       vectors[3].addElement("91746 / 30582 = 3");
       vectors[3].addElement("96174 / 32058 = 3");
       vectors[4].addElement("15768 / 03942 = 4");
       vectors[4].addElement("17568 / 04392 = 4");
       vectors[4].addElement("23184 / 05796 = 4");
       vectors[4].addElement("31824 / 07956 = 4");
       vectors[4].addElement("60948 / 15237 = 4");
       vectors[4].addElement("68940 / 17235 = 4");
       vectors[4].addElement("69408 / 17352 = 4");
       vectors[4].addElement("81576 / 20394 = 4");
       vectors[4].addElement("81756 / 20439 = 4");
       vectors[4].addElement("86940 / 21735 = 4");
       vectors[4].addElement("94068 / 23517 = 4");
       vectors[4].addElement("94860 / 23715 = 4");
       vectors[5].addElement("13485 / 02697 = 5");
       vectors[5].addElement("13845 / 02769 = 5");
       vectors[5].addElement("14685 / 02937 = 5");
       vectors[5].addElement("14835 / 02967 = 5");
       vectors[5].addElement("14865 / 02973 = 5");
       vectors[5].addElement("16485 / 03297 = 5");
       vectors[5].addElement("18645 / 03729 = 5");
       vectors[5].addElement("31485 / 06297 = 5");
       vectors[5].addElement("38145 / 07629 = 5");
       vectors[5].addElement("46185 / 09237 = 5");
       vectors[5].addElement("48135 / 09627 = 5");
       vectors[5].addElement("48615 / 09723 = 5");
       vectors[5].addElement("67290 / 13458 = 5");
       vectors[5].addElement("67920 / 13584 = 5");
       vectors[5].addElement("69270 / 13854 = 5");
       vectors[5].addElement("72690 / 14538 = 5");
       vectors[5].addElement("72930 / 14586 = 5");
       vectors[5].addElement("73290 / 14658 = 5");
       vectors[5].addElement("76920 / 15384 = 5");
       vectors[5].addElement("79230 / 15846 = 5");
       vectors[5].addElement("79320 / 15864 = 5");
       vectors[5].addElement("92670 / 18534 = 5");
       vectors[5].addElement("92730 / 18546 = 5");
       vectors[5].addElement("93270 / 18654 = 5");
       vectors[6].addElement("17658 / 02943 = 6");
       vectors[6].addElement("27918 / 04653 = 6");
       vectors[6].addElement("34182 / 05697 = 6");
       vectors[7].addElement("16758 / 02394 = 7");
       vectors[7].addElement("18459 / 02637 = 7");
       vectors[7].addElement("31689 / 04527 = 7");
       vectors[7].addElement("36918 / 05274 = 7");
       vectors[7].addElement("37926 / 05418 = 7");
       vectors[7].addElement("41832 / 05976 = 7");
       vectors[7].addElement("53298 / 07614 = 7");
       vectors[7].addElement("98532 / 14076 = 7");
       vectors[8].addElement("25496 / 03187 = 8");
       vectors[8].addElement("36712 / 04589 = 8");
       vectors[8].addElement("36728 / 04591 = 8");
       vectors[8].addElement("37512 / 04689 = 8");
       vectors[8].addElement("37528 / 04691 = 8");
       vectors[8].addElement("38152 / 04769 = 8");
       vectors[8].addElement("41896 / 05237 = 8");
       vectors[8].addElement("42968 / 05371 = 8");
       vectors[8].addElement("46312 / 05789 = 8");
       vectors[8].addElement("46328 / 05791 = 8");
       vectors[8].addElement("46712 / 05839 = 8");
       vectors[8].addElement("47136 / 05892 = 8");
       vectors[8].addElement("47328 / 05916 = 8");
       vectors[8].addElement("47368 / 05921 = 8");
       vectors[8].addElement("51832 / 06479 = 8");
       vectors[8].addElement("53928 / 06741 = 8");
       vectors[8].addElement("54312 / 06789 = 8");
       vectors[8].addElement("54328 / 06791 = 8");
       vectors[8].addElement("54712 / 06839 = 8");
       vectors[8].addElement("56984 / 07123 = 8");
       vectors[8].addElement("58496 / 07312 = 8");
       vectors[8].addElement("58912 / 07364 = 8");
       vectors[8].addElement("59328 / 07416 = 8");
       vectors[8].addElement("59368 / 07421 = 8");
       vectors[8].addElement("63152 / 07894 = 8");
       vectors[8].addElement("63528 / 07941 = 8");
       vectors[8].addElement("65392 / 08174 = 8");
       vectors[8].addElement("65432 / 08179 = 8");
       vectors[8].addElement("67152 / 08394 = 8");
       vectors[8].addElement("67352 / 08419 = 8");
       vectors[8].addElement("67512 / 08439 = 8");
       vectors[8].addElement("71456 / 08932 = 8");
       vectors[8].addElement("71536 / 08942 = 8");
       vectors[8].addElement("71624 / 08953 = 8");
       vectors[8].addElement("71632 / 08954 = 8");
       vectors[8].addElement("73248 / 09156 = 8");
       vectors[8].addElement("73264 / 09158 = 8");
       vectors[8].addElement("73456 / 09182 = 8");
       vectors[8].addElement("74528 / 09316 = 8");
       vectors[8].addElement("74568 / 09321 = 8");
       vectors[8].addElement("74816 / 09352 = 8");
       vectors[8].addElement("75328 / 09416 = 8");
       vectors[8].addElement("75368 / 09421 = 8");
       vectors[8].addElement("76184 / 09523 = 8");
       vectors[8].addElement("76248 / 09531 = 8");
       vectors[8].addElement("76328 / 09541 = 8");
       vectors[8].addElement("83672 / 10459 = 8");
       vectors[8].addElement("83752 / 10469 = 8");
       vectors[8].addElement("84296 / 10537 = 8");
       vectors[8].addElement("84632 / 10579 = 8");
       vectors[8].addElement("84736 / 10592 = 8");
       vectors[8].addElement("85392 / 10674 = 8");
       vectors[8].addElement("85432 / 10679 = 8");
       vectors[8].addElement("85936 / 10742 = 8");
       vectors[8].addElement("86352 / 10794 = 8");
       vectors[8].addElement("87456 / 10932 = 8");
       vectors[8].addElement("87536 / 10942 = 8");
       vectors[8].addElement("87624 / 10953 = 8");
       vectors[8].addElement("87632 / 10954 = 8");
       vectors[8].addElement("96584 / 12073 = 8");
       vectors[8].addElement("98456 / 12307 = 8");
       vectors[8].addElement("98760 / 12345 = 8");
       vectors[9].addElement("57429 / 06381 = 9");
       vectors[9].addElement("58239 / 06471 = 9");
       vectors[9].addElement("75249 / 08361 = 9");
       vectors[9].addElement("95742 / 10638 = 9");
       vectors[9].addElement("95823 / 10647 = 9");
       vectors[9].addElement("97524 / 10836 = 9");
       vectors[12].addElement("45792 / 03816 = 12");
       vectors[12].addElement("73548 / 06129 = 12");
       vectors[12].addElement("89532 / 07461 = 12");
       vectors[12].addElement("91584 / 07632 = 12");
       vectors[13].addElement("67392 / 05184 = 13");
       vectors[13].addElement("81549 / 06273 = 13");
       vectors[13].addElement("94653 / 07281 = 13");
       vectors[14].addElement("25746 / 01839 = 14");
       vectors[14].addElement("27384 / 01956 = 14");
       vectors[14].addElement("41538 / 02967 = 14");
       vectors[14].addElement("46158 / 03297 = 14");
       vectors[14].addElement("51492 / 03678 = 14");
       vectors[14].addElement("54768 / 03912 = 14");
       vectors[14].addElement("61572 / 04398 = 14");
       vectors[14].addElement("65982 / 04713 = 14");
       vectors[15].addElement("27945 / 01863 = 15");
       vectors[15].addElement("92745 / 06183 = 15");
       vectors[16].addElement("45936 / 02871 = 16");
       vectors[16].addElement("73296 / 04581 = 16");
       vectors[16].addElement("98352 / 06147 = 16");
       vectors[17].addElement("26843 / 01579 = 17");
       vectors[17].addElement("28543 / 01679 = 17");
       vectors[17].addElement("29546 / 01738 = 17");
       vectors[17].addElement("36958 / 02174 = 17");
       vectors[17].addElement("45713 / 02689 = 17");
       vectors[17].addElement("45781 / 02693 = 17");
       vectors[17].addElement("54689 / 03217 = 17");
       vectors[17].addElement("59126 / 03478 = 17");
       vectors[17].addElement("64957 / 03821 = 17");
       vectors[17].addElement("65297 / 03841 = 17");
       vectors[17].addElement("67184 / 03952 = 17");
       vectors[17].addElement("67218 / 03954 = 17");
       vectors[17].addElement("76823 / 04519 = 17");
       vectors[17].addElement("76891 / 04523 = 17");
       vectors[17].addElement("78132 / 04596 = 17");
       vectors[17].addElement("78523 / 04619 = 17");
       vectors[17].addElement("78591 / 04623 = 17");
       vectors[17].addElement("81532 / 04796 = 17");
       vectors[17].addElement("83572 / 04916 = 17");
       vectors[17].addElement("83657 / 04921 = 17");
       vectors[17].addElement("89437 / 05261 = 17");
       vectors[17].addElement("89471 / 05263 = 17");
       vectors[17].addElement("89641 / 05273 = 17");
       vectors[17].addElement("91426 / 05378 = 17");
       vectors[17].addElement("92837 / 05461 = 17");
       vectors[17].addElement("92871 / 05463 = 17");
       vectors[17].addElement("93126 / 05478 = 17");
       vectors[18].addElement("28674 / 01593 = 18");
       vectors[19].addElement("51984 / 02736 = 19");
       vectors[19].addElement("81567 / 04293 = 19");
       vectors[22].addElement("51678 / 02349 = 22");
       vectors[23].addElement("36294 / 01578 = 23");
       vectors[23].addElement("81627 / 03549 = 23");
       vectors[23].addElement("81972 / 03564 = 23");
       vectors[24].addElement("39528 / 01647 = 24");
       vectors[24].addElement("46872 / 01953 = 24");
       vectors[26].addElement("42978 / 01653 = 26");
       vectors[26].addElement("56498 / 02173 = 26");
       vectors[26].addElement("61854 / 02379 = 26");
       vectors[26].addElement("67314 / 02589 = 26");
       vectors[26].addElement("67418 / 02593 = 26");
       vectors[26].addElement("76518 / 02943 = 26");
       vectors[26].addElement("82654 / 03179 = 26");
       vectors[26].addElement("89726 / 03451 = 26");
       vectors[26].addElement("92846 / 03571 = 26");
       vectors[27].addElement("39852 / 01476 = 27");
       vectors[27].addElement("49572 / 01836 = 27");
       vectors[27].addElement("69741 / 02583 = 27");
       vectors[27].addElement("96714 / 03582 = 27");
       vectors[28].addElement("75348 / 02691 = 28");
       vectors[29].addElement("37584 / 01296 = 29");
       vectors[29].addElement("73689 / 02541 = 29");
       vectors[32].addElement("75168 / 02349 = 32");
       vectors[35].addElement("48265 / 01379 = 35");
       vectors[35].addElement("63945 / 01827 = 35");
       vectors[35].addElement("64295 / 01837 = 35");
       vectors[35].addElement("74865 / 02139 = 35");
       vectors[35].addElement("93485 / 02671 = 35");
       vectors[37].addElement("65934 / 01782 = 37");
       vectors[38].addElement("65892 / 01734 = 38");
       vectors[38].addElement("74328 / 01956 = 38");
       vectors[43].addElement("93654 / 02178 = 43");
       vectors[44].addElement("58476 / 01329 = 44");
       vectors[44].addElement("59268 / 01347 = 44");
       vectors[44].addElement("67892 / 01543 = 44");
       vectors[44].addElement("69432 / 01578 = 44");
       vectors[44].addElement("95348 / 02167 = 44");
       vectors[46].addElement("58374 / 01269 = 46");
       vectors[52].addElement("95472 / 01836 = 52");
       vectors[53].addElement("65879 / 01243 = 53");
       vectors[53].addElement("75896 / 01432 = 53");
       vectors[53].addElement("84376 / 01592 = 53");
       vectors[53].addElement("92538 / 01746 = 53");
       vectors[59].addElement("73986 / 01254 = 59");
       vectors[62].addElement("79546 / 01283 = 62");
       vectors[62].addElement("94736 / 01528 = 62");
       vectors[66].addElement("83754 / 01269 = 66");
       vectors[68].addElement("98736 / 01452 = 68");

       String line = readLn();
       while (!line.equals("0")) {
           int index = Integer.parseInt(line);
           if (vectors[index].size() == 0) {
               System.out.println("There are no solutions for " + index + ".");
           } else {
               int length = vectors[index].size();
               for (int k = 0; k < length; k++) {
                   System.out.println(vectors[index].elementAt(k));
               }
           }
           line = readLn();
           
           if (!"0".equals(line)) System.out.println();
           
       }

   }

   static String readLn() {
       String newLine = System.getProperty("line.separator");
       StringBuffer buffer = new StringBuffer();
       int car = -1;
       try {
           car = System.in.read();
           while ((car > 0) && (car != newLine.charAt(0))) {
               buffer.append((char) car);
               car = System.in.read();
           }
           if (car == newLine.charAt(0))
               System.in.skip(newLine.length() - 1);
       } catch (java.io.IOException e) {
           return (null);
       }
       if ((car < 0) && (buffer.length() == 0))
           return (null);
       return (buffer.toString()).trim();
   }
}